<?php
/**
 * @file A place to put arbitrary functions until there are enough of them to
 * warrant a more proper organizational method.
 */

function head() {
  $domain = constant('domain');
  $prefix = constant('prefix');
  $root = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/static/';
  $css = $root . 'css/';
  $scripts = $root . 'scripts/*.js';
  print_r($root);
}

/**
 * Define some values for use later on.
 */
function bootstrap() {
  // domain = the top level fully qualified domain.
  define('domain', $_SERVER['HTTP_HOST']);
  // prefix = the path to the site from the domain.
  define('prefix', dirname($_SERVER['REQUEST_URI']));
  
  $args = $_REQUEST;
  // The arguments passed, potentially including the path
  define('args', serialize($args));
  // q is short for query, or the path, if set
  if (isset($args['q'])) {
    define('path', $args['q']);
  }
  else if (isset($_SERVER['PATH_INFO'])) {
    define('path',$_SERVER['PATH_INFO']);
  }
  else {
    define('path', '');
  }
}
